package com.teamwork.module03.controller;

import com.teamwork.common.result.Result;
import com.teamwork.module03.service.DataService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/datas")
public class DataController {

    @Resource
    private DataService dataService;

    @GetMapping
    public Result getArticleDatas(Integer userid){
        return dataService.getArticleDatas(userid);
    }
    @GetMapping("/hotarticles")
    public Result getHotArtices(Integer userid){
        return dataService.getHotArticles(userid);
    }

    //管理员获取平台数据
    @GetMapping("/getdatas")
    public Result getDatas(Integer userid){
        return dataService.getDatas(userid);
    }

}
